<?php
/**
 * Created by 沧月
 * User: Lhhhh丶
 * Date: 2019/5/20
 * Time: 1:52
 */

namespace app\api\behavior;


class CORS
{
    public function appInit(&$params){
        header('Access-Control-Allow-Origin: *');
        header("Access-Control-Allow-Headers: token,Origin,X-Requested-With,Content-Type,Accept");
        header('Access-Control-Allow-Methods: PUT,POST,GET');
        if(request()->isOptions()){
            exit();
        }
    }
}